﻿namespace Example.Structural.Bridge
{
    using System;

    public sealed class Dimmer : IPower
    {
        public int Voltage { get; private set; }

        public void Off()
        {
            Voltage = 0;
        }

        public void On(int dial)
        {
            if (0 > dial ||
                10 < dial)
            {
                throw new ArgumentOutOfRangeException("dial");
            }

            Voltage = dial * 24;
        }
    }
}